package dotdashdot.bradz.trendsettr;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.NavUtils;
import android.view.MenuItem;

public class ActivityCreateItemDetail extends FragmentActivity {

	private ClassUberLogger logger;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_start_trend_item_detail);
		logger = new ClassUberLogger("ActivityCreateItemDetail");

		if (savedInstanceState == null) {
			// Create the detail fragment and add it to the activity
			// using a fragment transaction.
			Bundle arguments = new Bundle();
			arguments.putString(FragmentCreateItemDetail.ARG_ITEM_ID, getIntent().getStringExtra(FragmentCreateItemDetail.ARG_ITEM_ID));
			FragmentCreateItemDetail fragment = new FragmentCreateItemDetail();
			fragment.setArguments(arguments);
			getSupportFragmentManager().beginTransaction().add(R.id.item_detail_container, fragment).commit();
		}
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		int id = item.getItemId();
		if (id == android.R.id.home) {
			NavUtils.navigateUpTo(this,new Intent(this, ActivityCreateItemList.class));
			return true;
		}
		return super.onOptionsItemSelected(item);
	}
}
